import {
  Zap,
  MessageSquare,
  Database,
  Code,
  GitBranch,
  Filter,
  Mail,
  FileText,
  Globe,
  Brain,
  DatabaseIcon,
  Search,
  Calculator,
  type LucideIcon,
} from "lucide-react"
import type { WorkflowNode, AgentComponent } from "@/lib/mock-data"

const iconMap: Record<string, LucideIcon> = {
  Zap,
  MessageSquare,
  Database,
  Code,
  GitBranch,
  Filter,
  Mail,
  FileText,
  Globe,
  Brain,
  DatabaseIcon,
  Search,
  Calculator,
}

export function getNodeIcon(node: WorkflowNode | AgentComponent): LucideIcon {
  const iconName = node.config?.iconName
  if (iconName && iconMap[iconName]) {
    return iconMap[iconName]
  }
  // Default fallback icon
  return Code
}
